import { CorllerController, LoginController} from '../controller/index'
import { Methods } from './controller'

// 工厂函数
function getRouterDecorator(type: Methods) {
    return function (path: string) {
        return function (target: CorllerController|LoginController, key: string) {
            Reflect.defineMetadata('path', path, target, key)
            Reflect.defineMetadata('method', type, target, key)
        }
    }
}

export const get = getRouterDecorator(Methods.get)
export const post = getRouterDecorator(Methods.post)
// export const inp = getRouterDecorator('put')
// export const del = getRouterDecorator('delele')